using Microsoft.TeamFoundation.Client;
using Microsoft.TeamFoundation.Server;

namespace Microsoft.Services.TfsAlert.AppCode
{
    public class TeamFoundationFactory
    {
        public virtual IEventService GetEventService( string serverName )
        {
            TeamFoundationServer tfsServer = null;

            tfsServer = TeamFoundationServerFactory.GetServer( serverName, new UICredentialsProvider() );
            tfsServer.EnsureAuthenticated();

            return (IEventService)tfsServer.GetService( typeof( IEventService ) );
        }
    }
}